Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2468561ybl; Thu, 29 Aug 2019 08:34:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYV2ZPL4wVxyW7irUEaxca81DwSTp2UW+wL/REQIvsJqKu7Y4WqwHmOe39gvKNIeWEWP0u X-Received: by 2002:a17:902:b40c:: with SMTP id x12mr10547407plr.81.1567092895500; Thu, 29 Aug 2019 08:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567092895; cv=none; d=google.com; s=arc-20160816; b=hTRWGSqXtSqH855wTLqtYVHe20iw7E5PgIxwEz2R/Uid28ESPkTDw8OkevvggHiFTl gZvmvGokTmjCuhnc21q5ZRp0Az1H12QELYn8zREgjkw6JQ/5lkVxC1TaFk2Bj/W9BvGr ZhtYRhAZ24dSHoZnYkPTlYfpywK2zV+CyAPmdGKQYwwezTOSm9ynq3Emlihcojna/GkL 4qZRqYKGvVKICk6NbFdvvslBs+6u2YfSKkSnGQeQHCcxr27be93m3tT1lW//SeGy2qp7 n2Qb3EO9XMFbQq3lW3FdzdLpbSkdlRXhQ+m9k6uDm5l1v0A67AbBkPcttNPDVtaL2aPF mOUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Rbjz2X90VdQD30qgQblGHMm6dzBKGBcwAw5+it2jDPE=; b=EQqHRsWSkIO4sm90IEdRbX+7q2BXL6yPEn6giARaRyYQGM6ZZs++STeHx/1EGI3fe7 RZ3ZCLaF9TDuZLvWqeKOGVJ/mlbTXAj4xXu3mJd4Mj8xv/FZcChuC8/woa79o1xrnHmF tMmS1c6F0rY2VzMkD4Cyfm67lhe+twpLoj/pkvNWkAi2+Pz507Y5+AQmks8NRiIHtDmF UNypI6VobMe4iTgH/KSR0uuPv96og2OwdRXrHZ27L06yKyF8t1cULwDuno8SBGXp+eib HsmDJqFqB57tizl1FITbmvrtmrJm4yow8YgWBgoWDUI8TuoK1MHGxuYo7emk4n4aD5TO /iCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F7wo8ckz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si2121957pli.327.2019.08.29.08.34.39; Thu, 29 Aug 2019 08:34:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F7wo8ckz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbfH2Pb3 (ORCPT + 99 others); Thu, 29 Aug 2019 11:31:29 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42887 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbfH2Pb3 (ORCPT ); Thu, 29 Aug 2019 11:31:29 -0400 Received: by mail-wr1-f67.google.com with SMTP id b16so3870531wrq.9 for ; Thu, 29 Aug 2019 08:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Rbjz2X90VdQD30qgQblGHMm6dzBKGBcwAw5+it2jDPE=; b=F7wo8ckzJW/r0rXHOF3NTyPHRiYiDzLV9Nqq/9Nyz02llWBNe+F5anuuR5Abbba8gi OVnsbmCWqVVBRxIxDJ0Mypm+4vrkNWzONOUhTIa0wmQrfTc5cRZlKxjRe+5jK3cwsINk pFslYEimc05U4vnGMwY/4VMVIAddM1P7Cu/6S8fMepS31mgvnRtQFa88ZVVrZDTECtfc FOUvI42QBnST+Fr11rhAGKcmVP7wIc3FgfFuCskryHdcq6rD7z/BSUJ4ysBHMk0UeCLs Bz2ndDmO1r7lPDWBaJYtS0q6RGJ9Wos28VckcnAI55CQnhqNLIWhvgPpLzIm1lyJ8nAe xMqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Rbjz2X90VdQD30qgQblGHMm6dzBKGBcwAw5+it2jDPE=; b=GgWlYwJ9BfoJlgs9eAjL4fzNUi4qObevl8FNJ55r1fEF70LfRw1USFThjw2QPrholP 0f2QbhnNxK4fuRTOwGQTF9EAKDQuxlOnkwgqAFplJiJjeyn9xwzwxW5+aVbaOXQB7Wir GimaGo1xzo6w8cdgz/gH1Zmq4mmXFEvWHkK/0WpFiZvzPThB6HTau4yJpRdoqA6RunYc LAw/vapIkNxzAIf2hbd0kP5+0VK8oT2fQeUTf4MqrTQd9QEk+aFqoFo8d0sw0aSWQcdU VaJnThy7tF4TS2AIdzl0Bgtww54qrDkGIkFNnEqJcuFCwgDjX2JDpdHVZwKs2X08CDpy /CXg== X-Gm-Message-State: APjAAAWhrgivIxO2tKUdT2AqDqVx/2S3xp1jH3yNvopNPNnXdRcmD4v3 aUyrincn0AAbRJkIa95MiqHTHA== X-Received: by 2002:adf:db06:: with SMTP id s6mr1855272wri.348.1567092686839; Thu, 29 Aug 2019 08:31:26 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id r1sm2524685wro.13.2019.08.29.08.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 08:31:26 -0700 (PDT) Date: Thu, 29 Aug 2019 16:31:24 +0100 From: Daniel Thompson To: Jiada Wang Cc: nick@shmanahar.org, dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, george_davis@mentor.com Subject: Re: [PATCH v2 29/49] Input: atmel_mxt_ts - implement debug output for messages Message-ID: <20190829153124.cozqsegnmvxveecd@holly.lan> References: <20190827062943.20698-1-jiada_wang@mentor.com> <20190827062943.20698-5-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190827062943.20698-5-jiada_wang@mentor.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 03:29:23PM +0900, Jiada Wang wrote: > From: Nick Dyer > > Add a debug switch which causes all messages from the touch controller to > be dumped to the dmesg log with a set prefix "MXT MSG:". This is used by > Atmel user-space utilities to debug touch operation. Enabling this output > does impact touch performance. > > Signed-off-by: Nick Dyer > (cherry picked from ndyer/linux/for-upstream commit 3c3fcfdd4889dfeb1c80ae8cd94a622c6342b06a) > [gdavis: Forward port and fix conflicts.] > Signed-off-by: George G. Davis > Signed-off-by: Jiada Wang > --- > drivers/input/touchscreen/atmel_mxt_ts.c | 44 ++++++++++++++++++++++-- > 1 file changed, 41 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c > index 2d2e8ea30547..941c6970cb70 100644 > --- a/drivers/input/touchscreen/atmel_mxt_ts.c > +++ b/drivers/input/touchscreen/atmel_mxt_ts.c > @@ -335,6 +335,7 @@ struct mxt_data { > u8 t100_aux_ampl; > u8 t100_aux_area; > u8 t100_aux_vect; > + bool debug_enabled; > u8 max_reportid; > u32 config_crc; > u32 info_crc; > @@ -460,8 +461,8 @@ static bool mxt_object_readable(unsigned int type) > > static void mxt_dump_message(struct mxt_data *data, u8 *message) > { > - dev_dbg(&data->client->dev, "message: %*ph\n", > - data->T5_msg_size, message); > + dev_dbg(&data->client->dev, "MXT MSG: %*ph\n", > + data->T5_msg_size, message); I'm not 100% convinced that the kernel should change here (arguably the userspace utility should be modified instead) but if the messages are conforming to some sort of vendor specific protocol then some commenting is needed. > @@ -3538,6 +3573,8 @@ static DEVICE_ATTR(hw_version, S_IRUGO, mxt_hw_version_show, NULL); > static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL); > static DEVICE_ATTR(update_cfg, S_IWUSR, NULL, mxt_update_cfg_store); > static DEVICE_ATTR(config_crc, S_IRUGO, mxt_config_crc_show, NULL); > +static DEVICE_ATTR(debug_enable, S_IWUSR | S_IRUSR, mxt_debug_enable_show, > + mxt_debug_enable_store); Why isn't CONFIG_DYNAMIC_DEBUG sufficient to enable/disable the messages? Daniel.